FROM ubuntu

#/var/run/docker.sock
RUN apt update && apt install ssh golang sudo vim git etcd apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
    software-properties-common -y \
   && curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - \
   && add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"  

RUN apt-get update -y && apt-get install docker-ce docker-ce-cli containerd.io -y

RUN service ssh start

RUN git clone https://github.com/kubesphere/kubekey \
    && cd kubekey && GOOS=linux GOARCH=amd64 CGO_ENABLED=0 GO111MODULE=on \
    go build  -o /usr/local/bin/kk ./cmd/kk/main.go
